package com.kongwg.java;
import java.util.ArrayList;
import java.util.List;

/**
 * @author kongwg
 * @create 2020-12-17 11:21
 */
public class Order<T> {

    String name;
    int age;

    T orderT;

    public Order(){

    }
    public Order(String name,int age,T orderT){}

    public T getOrderT(){
        return orderT;


    }
    public void setOrderT(T orderT){
        this.orderT = orderT;
    }

    @Override
    public String toString() {
        return "Order{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", orderT=" + orderT +
                '}';
    }

    //泛型方法
    public static  <E> List<E> copyFormArray(E[] arr){

        ArrayList<E> list = new ArrayList<>();

        for (E e : arr){
            list.add(e);
        }

        return list;
    }
}
